//
//  SV_InfiniteView.m
//  ChunLaiZhuangClient
//
//  Created by xielihui on 16/4/18.
//  Copyright © 2016年 CLZ. All rights reserved.
//

#import "SV_InfiniteView.h"

@implementation SV_InfiniteView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIImageView *logoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(148.0, 13.0, 24.0, 24.0)];
        logoImageView.image = [UIImage imageNamed:@"loading"];
        [self addSubview:logoImageView];
        
        CABasicAnimation* rotationAnimation;
        rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
        rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0];
        rotationAnimation.duration = 3.0;
        rotationAnimation.cumulative = YES;
        rotationAnimation.repeatCount = HUGE_VALF;
        
        [logoImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
    }
    return self;
}

@end
